//
// Created by alexa on 5/26/2024.
//

#include "AboutAuthorMenu.h"
#include "../../keydown-handler/KeydownHandler.h"

AboutAuthorMenu::AboutAuthorMenu(i18n::Translator *t, UserInterface *ui) : Menu(t, ui) {}

void AboutAuthorMenu::displayMenu() {
    printMenu();
    return keydownHandle(ui->getPressedKey, {
            {Keys::TAB, [this]() {
                ui->toggleLocale();
                return displayMenu();
            }},
            {Keys::ESC, [this]() {
                ui->setCurrentPage(Pages::PREVIEW_MENU);
                return;
            }}
    });
}

void AboutAuthorMenu::printMenu() {
    clearScreen();
    printKeybinds();
    cout << (*t)("title", "about-author") << endl;
    cout << (*t)("text", "about-author") << endl;
}